package com.yzjs.localhost.controller.tNeusoftUniformityTesting;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

import com.yzjs.common.enumeration.RequestMethod;
import com.yzjs.localhost.dto.TNeusoftUniformityTestingDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import com.yzjs.common.base.entity.PageInfo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.yzjs.localhost.entity.tNeusoftUniformityTesting.TNeusoftUniformityTestingEntity;
import com.yzjs.localhost.service.tNeusoftUniformityTesting.TNeusoftUniformityTestingService;




/**
 * 数据一致性检测
 *
 * @author yuqiumin
 * @email sunlightcs@gmail.com
 * @date 2021-09-04 11:26:24
 */
@Api(tags = "数据一致性检测")
@RestController
@RequestMapping("tNeusoftUniformityTesting")
public class TNeusoftUniformityTestingController {
    @Autowired
    private TNeusoftUniformityTestingService tNeusoftUniformityTestingService;




    /**
     * 详情信息
     */
    @ApiOperation(value="详情信息" ,httpMethod =RequestMethod.GET )
    @RequestMapping("/getDetail")
    public TNeusoftUniformityTestingDTO getDetail(@RequestParam(required = true)   Integer id) throws Exception {
        TNeusoftUniformityTestingEntity  query = new TNeusoftUniformityTestingEntity();
        query.setId(id);
        TNeusoftUniformityTestingDTO dto = tNeusoftUniformityTestingService.getDetail(query);
        return  dto ;
    }
    /**
    * 列表查询
    * @return
    */
    @ApiOperation(value="列表查询" ,httpMethod =RequestMethod.POST )
    @RequestMapping("/list")
    public List<TNeusoftUniformityTestingEntity> List( @RequestBody TNeusoftUniformityTestingEntity tNeusoftUniformityTesting) {

        List<TNeusoftUniformityTestingEntity> tNeusoftUniformityTestings = tNeusoftUniformityTestingService.findList(tNeusoftUniformityTesting);
        return tNeusoftUniformityTestings;
    }


    /**
     * 分页查询
     * @param tNeusoftUniformityTesting
     * @return
     */
    @ApiOperation(value="分页查询" ,httpMethod =RequestMethod.POST )
    @RequestMapping("/listPage")
    public PageInfo<TNeusoftUniformityTestingEntity> listPage(@RequestBody TNeusoftUniformityTestingEntity tNeusoftUniformityTesting) {
        List<TNeusoftUniformityTestingEntity> tNeusoftUniformityTestings  = tNeusoftUniformityTestingService.findList(tNeusoftUniformityTesting);
        return new PageInfo<>(tNeusoftUniformityTestings ,tNeusoftUniformityTesting);
    }


    /**
     * 保存
     */
    @ApiOperation(value="保存" ,httpMethod =RequestMethod.POST )
    @RequestMapping("/save")
    public TNeusoftUniformityTestingEntity save(@RequestBody TNeusoftUniformityTestingEntity tNeusoftUniformityTesting){
		tNeusoftUniformityTestingService.insert(tNeusoftUniformityTesting);
        return tNeusoftUniformityTesting;
    }

    /**
     * 处置
     */
    @ApiOperation(value="处置" ,httpMethod =RequestMethod.POST )
    @RequestMapping("/deal")
    public TNeusoftUniformityTestingEntity update(@RequestBody TNeusoftUniformityTestingEntity tNeusoftUniformityTesting) throws Exception {
		tNeusoftUniformityTestingService.deal(tNeusoftUniformityTesting);
        return tNeusoftUniformityTesting;
    }

    /**
     * 删除
     */
    @ApiOperation(value="删除" ,httpMethod =RequestMethod.DELETE )
    @RequestMapping("/delete")
    public TNeusoftUniformityTestingEntity  delete( @RequestParam(required = true)  Integer id){
        TNeusoftUniformityTestingEntity  delete  = new TNeusoftUniformityTestingEntity();
        delete.setId(id);
        tNeusoftUniformityTestingService.delete(delete);
        return delete;
    }

}
